package com.tencent.wxcloudrun.controller.zuke;

import com.tencent.wxcloudrun.config.ApiResponse;
import com.tencent.wxcloudrun.pojo.dto.req.BeZuKeReq;
import com.tencent.wxcloudrun.pojo.dto.resp.GetZuKePageResp;
import com.tencent.wxcloudrun.service.business.zuke.ZuKePersonService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;

@RestController
@RequestMapping("/zukePerson")
@Validated
public class ZuKePersonController {

    @Resource
    private ZuKePersonService zuKePersonService;

    @PostMapping("/beZuKe")
    public ApiResponse<String> beZuKe(@Valid @RequestBody BeZuKeReq req) {
        return new ApiResponse<>(zuKePersonService.beZuKe(req));
    }

    @GetMapping("/getPage")
    public ApiResponse<GetZuKePageResp> getPage() {
        return new ApiResponse<>(zuKePersonService.getPage());
    }
}
